products = [["iphone",6888],["macpro",14800],["小米6",2499],["coffee",31],["book",60],["nike",699]]
shop_car = []
shop_cost = []
print("- " * 3,"商品列表","- " * 3)
for i in products:
    print(i[0],"\t  ",i[1])
    shop_car.append([i[0],i[1],0])

print("选择请输入商品名称，退出请输入q")
a = input("选择你的商品:  ")
while a != "q":
    for i in shop_car:
        if a == i[0]:
            i[2] +=1
            break
    else:
        print("输入商品有误")
    a = input("选择你的商品:  ")
    
print("- " * 1,"你选择的商品列表","- " * 1)
for i in shop_car:
    if i[2] > 0 :
        shop_cost.append(i[1]*i[2])
        print("{}，{}件,共{}元".format(i[0],i[2],i[1]*i[2]))
print("价格总计：",sum(shop_cost),"元")

#  少个购买成功的提示，别的没有啥问题